<?php
use_helper('I18N');
?>
<script type="text/javascript" language="javascript">
    var usdToMyr = "";
    $(function() {
        $("#btnSubmit").click(function(){
            $("#registerForm").submit();
        });
        $("#registerForm").validate({
            messages : {
                confirmPassword: {
                    equalTo: "<?php echo __('Please enter the same password as above') ?>"
                },
                userName: {
                    remote: "<?php echo __('User Name already in use') ?>."
                },
                fullname: {
                    remote: "<?php echo __('Full Name already in use') ?>."
                }
            },
            rules : {
                "fullname" : {
                    required : true,
                    minlength : 2
                },
                "contactNumber" : {
                    required : true
                },
                "email" : {
                    required : true
                    , email: true
                }
            },
            submitHandler: function(form) {
                waiting();
                form.submit();
            },
            success: function(label) {
            }
        });
    }); // end function
</script>
<div class="row">
    <div class="col-md-12">
        <h2 class="page-title"><?php echo __("Open Demo Account"); ?>
            <small></small>
        </h2>
    </div>
</div>
<div class="row">
    <div class="col-md-7">
        <section class="widget">
            <header>
                <h4>
                    <i class="icon-ok-sign"></i>
                    <?php echo __("Open Demo Account"); ?>
                    <small></small>
                </h4>
            </header>
            <div class="body">
                <form class="form-horizontal label-left" method="post"
                      action="/demo/doRegister"
                      data-validate="parsley"
                      id="registerForm" name="registerForm">
                    <input type="hidden" name="p" value="p">
                    <fieldset>
                        <legend class="section">
                        <?php echo __("Personal Information")?>
                        </legend>
                        <?php include_component('component', 'alert', array('param' => $sf_user->getAttribute(Globals::SESSION_DISTID, 0))) ?>
                        <div class="row">
                            <div class="col-sm-8">

                                <div class="control-group">
                                    <label class="control-label" for="fullname">
                                    <?php echo __("Full Name")?>
                                    </label>

                                    <div class="controls form-group">
                                        <input name="fullname" id="fullname" class="form-control" type="text">
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label" for="country">
                                    <?php echo __("Country")?>
                                    </label>

                                    <div class="controls form-group">
                                        <?php include_component('component', 'countrySelectOption', array('countrySelected' => "Malaysia", 'countryName' => 'country', 'countryId' => 'country', 'class' => 'form-control')) ?>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label" for="contactNumber">
                                    <?php echo __("Contact Number")?>
                                    </label>

                                    <div class="controls form-group">
                                        <input name="contactNumber" id="contactNumber" class="form-control" type="text">
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label" for="email">
                                    <?php echo __("Email Address")?>
                                    </label>

                                    <div class="controls form-group">
                                        <input name="email" id="email" class="form-control" type="text">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </fieldset>
                    <div class="form-actions">
                        <button type="button" id="btnSubmit" class="btn btn-danger"><?php echo __("Submit");?></button>
                        <a href="/member/summary" class="btn btn-default"><?php echo __("Cancel");?></a>
                    </div>
                </form>
            </div>
        </section>
    </div>
</div>